.class abstract Lcom/greystripe/sdk/am;
.super Lcom/greystripe/sdk/z;

# interfaces
.implements Lcom/greystripe/sdk/GSAd;


# instance fields
.field private a:Lcom/greystripe/sdk/ai;

.field private b:Landroid/view/animation/Animation;

.field private c:Lcom/greystripe/sdk/an;

.field private d:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V
    .locals 3

    invoke-direct {p0, p1, p2, p3}, Lcom/greystripe/sdk/z;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V

    if-eqz p2, :cond_0

    const-string v0, "http://schemas.android.com/apk/lib/com.greystripe.sdk"

    const-string v1, "autoload"

    const/4 v2, 0x1

    invoke-interface {p2, v0, v1, v2}, Landroid/util/AttributeSet;->getAttributeBooleanValue(Ljava/lang/String;Ljava/lang/String;Z)Z

    move-result v0

    iput-boolean v0, p0, Lcom/greystripe/sdk/am;->d:Z

    :cond_0
    return-void
.end method

.method static synthetic a(Lcom/greystripe/sdk/am;)Lcom/greystripe/sdk/ai;
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    return-object v0
.end method

.method static synthetic b(Lcom/greystripe/sdk/am;)Landroid/view/animation/Animation;
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->b:Landroid/view/animation/Animation;

    return-object v0
.end method

.method private c()V
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    iget-object v0, v0, Lcom/greystripe/sdk/ai;->c:Lcom/greystripe/sdk/aj;

    invoke-virtual {v0, p0}, Lcom/greystripe/sdk/aj;->setBannerView(Lcom/greystripe/sdk/am;)V

    goto :goto_0
.end method


# virtual methods
.method protected final a(Lcom/greystripe/sdk/ai;)V
    .locals 1

    iput-object p1, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-super {p0, v0}, Lcom/greystripe/sdk/z;->a(Lcom/greystripe/sdk/c;)V

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0, p0}, Lcom/greystripe/sdk/ai;->a(Lcom/greystripe/sdk/am;)V

    invoke-direct {p0}, Lcom/greystripe/sdk/am;->c()V

    return-void
.end method

.method public addListener(Lcom/greystripe/sdk/GSAdListener;)V
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0, p1}, Lcom/greystripe/sdk/ai;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    goto :goto_0
.end method

.method protected final b()Z
    .locals 1

    iget-boolean v0, p0, Lcom/greystripe/sdk/am;->d:Z

    return v0
.end method

.method public getId()I
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0}, Lcom/greystripe/sdk/ai;->getId()I

    move-result v0

    return v0
.end method

.method public isAdReady()Z
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0}, Lcom/greystripe/sdk/ai;->isAdReady()Z

    move-result v0

    goto :goto_0
.end method

.method public refresh()V
    .locals 2

    const/4 v1, 0x0

    const/4 v0, 0x0

    invoke-virtual {p0, v0, v1, v1}, Lcom/greystripe/sdk/am;->refresh(ZLandroid/view/animation/Animation;Landroid/view/animation/Animation;)V

    return-void
.end method

.method public refresh(Landroid/view/animation/Animation;Landroid/view/animation/Animation;)V
    .locals 1

    const/4 v0, 0x1

    invoke-virtual {p0, v0, p1, p2}, Lcom/greystripe/sdk/am;->refresh(ZLandroid/view/animation/Animation;Landroid/view/animation/Animation;)V

    return-void
.end method

.method public refresh(Z)V
    .locals 1

    const/4 v0, 0x0

    invoke-virtual {p0, p1, v0, v0}, Lcom/greystripe/sdk/am;->refresh(ZLandroid/view/animation/Animation;Landroid/view/animation/Animation;)V

    return-void
.end method

.method public refresh(ZLandroid/view/animation/Animation;Landroid/view/animation/Animation;)V
    .locals 7

    const-wide/16 v5, 0x1f4

    const/4 v4, 0x1

    const/high16 v3, 0x3f80

    const/4 v1, 0x0

    const/4 v2, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0}, Lcom/greystripe/sdk/ai;->d()V

    invoke-direct {p0}, Lcom/greystripe/sdk/am;->c()V

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    iput-boolean p1, v0, Lcom/greystripe/sdk/ai;->a:Z

    if-eqz p1, :cond_4

    if-eqz p2, :cond_2

    iput-object p2, p0, Lcom/greystripe/sdk/am;->b:Landroid/view/animation/Animation;

    :goto_1
    iget-object v0, p0, Lcom/greystripe/sdk/am;->c:Lcom/greystripe/sdk/an;

    if-nez v0, :cond_1

    new-instance v0, Lcom/greystripe/sdk/an;

    invoke-direct {v0, p0, v2}, Lcom/greystripe/sdk/an;-><init>(Lcom/greystripe/sdk/am;B)V

    iput-object v0, p0, Lcom/greystripe/sdk/am;->c:Lcom/greystripe/sdk/an;

    iget-object v0, p0, Lcom/greystripe/sdk/am;->c:Lcom/greystripe/sdk/an;

    invoke-virtual {p0, v0}, Lcom/greystripe/sdk/am;->addListener(Lcom/greystripe/sdk/GSAdListener;)V

    :cond_1
    if-eqz p3, :cond_3

    new-instance v0, Lcom/greystripe/sdk/ap;

    invoke-direct {v0, p0, v2}, Lcom/greystripe/sdk/ap;-><init>(Lcom/greystripe/sdk/am;B)V

    invoke-virtual {p3, v0}, Landroid/view/animation/Animation;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    invoke-virtual {p0, p3}, Lcom/greystripe/sdk/am;->startAnimation(Landroid/view/animation/Animation;)V

    goto :goto_0

    :cond_2
    new-instance v0, Landroid/view/animation/AlphaAnimation;

    invoke-direct {v0, v1, v3}, Landroid/view/animation/AlphaAnimation;-><init>(FF)V

    iput-object v0, p0, Lcom/greystripe/sdk/am;->b:Landroid/view/animation/Animation;

    iget-object v0, p0, Lcom/greystripe/sdk/am;->b:Landroid/view/animation/Animation;

    invoke-virtual {v0, v5, v6}, Landroid/view/animation/Animation;->setDuration(J)V

    iget-object v0, p0, Lcom/greystripe/sdk/am;->b:Landroid/view/animation/Animation;

    invoke-virtual {v0, v4}, Landroid/view/animation/Animation;->setFillAfter(Z)V

    goto :goto_1

    :cond_3
    new-instance v0, Landroid/view/animation/AlphaAnimation;

    invoke-direct {v0, v3, v1}, Landroid/view/animation/AlphaAnimation;-><init>(FF)V

    invoke-virtual {v0, v5, v6}, Landroid/view/animation/Animation;->setDuration(J)V

    invoke-virtual {v0, v4}, Landroid/view/animation/Animation;->setFillAfter(Z)V

    new-instance v1, Lcom/greystripe/sdk/ap;

    invoke-direct {v1, p0, v2}, Lcom/greystripe/sdk/ap;-><init>(Lcom/greystripe/sdk/am;B)V

    invoke-virtual {v0, v1}, Landroid/view/animation/Animation;->setAnimationListener(Landroid/view/animation/Animation$AnimationListener;)V

    invoke-virtual {p0, v0}, Lcom/greystripe/sdk/am;->startAnimation(Landroid/view/animation/Animation;)V

    goto :goto_0

    :cond_4
    iget-object v0, p0, Lcom/greystripe/sdk/am;->c:Lcom/greystripe/sdk/an;

    if-eqz v0, :cond_5

    invoke-virtual {p0}, Lcom/greystripe/sdk/am;->clearAnimation()V

    iget-object v0, p0, Lcom/greystripe/sdk/am;->c:Lcom/greystripe/sdk/an;

    invoke-virtual {p0, v0}, Lcom/greystripe/sdk/am;->removeListener(Lcom/greystripe/sdk/GSAdListener;)V

    const/4 v0, 0x0

    iput-object v0, p0, Lcom/greystripe/sdk/am;->c:Lcom/greystripe/sdk/an;

    :cond_5
    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0}, Lcom/greystripe/sdk/ai;->h()V

    goto :goto_0
.end method

.method public removeListener(Lcom/greystripe/sdk/GSAdListener;)V
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    if-nez v0, :cond_0

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/am;->a:Lcom/greystripe/sdk/ai;

    invoke-virtual {v0, p1}, Lcom/greystripe/sdk/ai;->removeListener(Lcom/greystripe/sdk/GSAdListener;)V

    goto :goto_0
.end method
